package com.jinlia.show.modules.base.system.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.jinlia.show.modules.base.config.DynamicSchemaConfig;
import lombok.Data;

import java.math.BigDecimal;

@Data
@TableName(value = "erp_order_item",schema = DynamicSchemaConfig.schema_system)
public class OrderItem {
    @TableId()
    private Long id;

    private Long orderId;
    private Long goodsId;
    private Long goodsType;
    private String goodsName;
    private int goodsNum;
    /**
     * 基础单价
     */
    private BigDecimal unitPrice;
    private BigDecimal originalMoney;
    /**
     * 折扣金额
     */
    private BigDecimal discountMoney;
    //应收 = baseSkuPrice * basePrice * 订单折扣率
    private BigDecimal receivableMoney;

    private String skuName;
    @TableField(typeHandler = JacksonTypeHandler.class)
    private JSONObject skuCode;
}
